<?php

/**
 * TbsClienteCupo form base class.
 *
 * @method TbsClienteCupo getObject() Returns the current form's model object
 *
 * @package    AltargetEcommerce
 * @subpackage form
 * @author     Carlo Lopez
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseTbsClienteCupoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'clcu_codigo'   => new sfWidgetFormInputHidden(),
      'clcu_fechaini' => new sfWidgetFormDate(),
      'clcu_fechafin' => new sfWidgetFormDate(),
      'clcu_fechagen' => new sfWidgetFormDate(),
      'clcu_cupemail' => new sfWidgetFormInputText(),
      'clcu_salemail' => new sfWidgetFormInputText(),
      'clcu_cupsms'   => new sfWidgetFormInputText(),
      'clcu_salsms'   => new sfWidgetFormInputText(),
      'clcu_status'   => new sfWidgetFormInputText(),
      'clcu_origen'   => new sfWidgetFormInputText(),
      'clcu_codcli'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('fk_clcu_codcli'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'clcu_codigo'   => new sfValidatorChoice(array('choices' => array($this->getObject()->get('clcu_codigo')), 'empty_value' => $this->getObject()->get('clcu_codigo'), 'required' => false)),
      'clcu_fechaini' => new sfValidatorDate(),
      'clcu_fechafin' => new sfValidatorDate(),
      'clcu_fechagen' => new sfValidatorDate(),
      'clcu_cupemail' => new sfValidatorInteger(),
      'clcu_salemail' => new sfValidatorInteger(),
      'clcu_cupsms'   => new sfValidatorInteger(),
      'clcu_salsms'   => new sfValidatorInteger(),
      'clcu_status'   => new sfValidatorString(array('max_length' => 1)),
      'clcu_origen'   => new sfValidatorString(array('max_length' => 1)),
      'clcu_codcli'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('fk_clcu_codcli'))),
    ));

    $this->widgetSchema->setNameFormat('tbs_cliente_cupo[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'TbsClienteCupo';
  }

}
